<!DOCTYPE html>
<html>
<#include "include/common-head.ftl"/>
<body class="bg-2">
<section class="loginBox">
    <form action="/forget" method="post">
        <dl>
            <dd class="userEmail loginLine">
                <input type="text" name="phone" id="username" placeholder="请输入手机号码"/>
                <i></i>
            </dd>
            <dd class="userEmail userPw loginLine">
                <input type="password" name="password" id="userpw" placeholder="请输入新密码（6-20字符）"/>
                <i></i>
            </dd>
            <dd class="userEmail userKey loginLine">
                <input type="text" name="" id="" placeholder="请输入邮箱验证码"/>
                <a>发送验证码</a>
                <i></i>
            </dd>
            <dd class="loginbtnBar">
                <a onclick="$('form').submit();">确定</a>
            </dd>
        </dl>

    </form>
</section>

<script>

    $('form').submit(function () {
        var phone = $("#username").val();
        var password = $("#userpw").val();
        if (phone.length !== 11 || phone.substr(0, 1) !== '1') {
            alert("电话号码格式错误");
            return false;
        }
        if (password.length < 6 || password.length > 20) {
            alert("密码长度为6到20位");
            return false;
        }
        return true;
    });
</script>
</body>
</html>
